<?php
$this->breadcrumbs=array(
	'Geranciar Comentários',
);
echo $this->renderPartial('_menu', array('menu_users'=>$menu_users));
?>

<h3>Geranciar Comentários</h3>

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'dataProvider'=>$model->mySearch(),
	//'filter'=>$model,
        'pager' => array('cssFile' => Yii::app()->baseUrl . '/themes/'.Yii::app()->theme->name.'/gridView.css'),
        'cssFile' => Yii::app()->baseUrl . '/themes/'.Yii::app()->theme->name.'/css/gridView.css',
        'summaryText' => 'De {start} - {end} entre {count} registros',
        'htmlOptions' => array('class' => 'grid-view rounded'),
	'columns'=>array(
		array(
			'name'=>'author',
			'filter'=>false,
			'value'=>'CHtml::encode($data->author)',
		),
		array(
			'name'=>'id',
			'filter'=>false,
			'value'=>'CHtml::encode($data->id)',
		),
		array(
			'name'=>'content',
			'type'=>'raw',
			'value'=>'CHtml::encode($data->content)',
		),
		array(
			'name'=>'author',
			'type'=>'raw',
			'value'=>'CHtml::encode($data->author)',
		),
		array(
			'name'=>'status',
			'value'=>'Lookup::item("CommentStatus",$data->status)',
			'filter'=>Lookup::items('CommentStatus'),
		),
		array(
			'class'=>'CButtonColumn',
                        'template' => '{update} {delete}',
                        'afterDelete'=>'function(link,success,data){ if(success) alert("Delete completed successfuly"); }'
		),
	),
)); ?>
